// [DFS递归]分割整数递归

#include <math.h>
#include <iostream>
#include <vector>
using namespace std;
vector<int> elsevec;
int n, m, sum3, sum5, dis0;

bool dfs(int i, int dis) {
  if (i == elsevec.size()) {
    return abs(dis) == dis0;
  }
  return (dfs(i + 1, dis + elsevec[i]) || dfs(i + 1, dis - elsevec[i]));
}

int main() {
  while (cin >> n) {
    sum3 = sum5 = 0;
    elsevec.clear();
    int t = n;
    while (t--) {
      cin >> m;
      if (m % 5 == 0) {
        sum5 += m;
      } else if (m % 3 == 0) {
        sum3 += m;
      } else {
        elsevec.push_back(m);
      }
    }
    dis0 = abs(sum5 - sum3);
    if (dfs(0, 0)) {
      cout << "true" << endl;
    } else {
      cout << "false" << endl;
    }
  }
  return 0;
}
